package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

/**
 * 将所有小写字母写入到文件fos.txt中
 */
public class Test {
    public static void main(String[] args) throws IOException {
        //'a'的ASCII码是97
        FileOutputStream fos = new FileOutputStream("fos2.txt");
//        String line = "abcdefghijklmnopqrstuvwxyz";
//        byte[] data = line.getBytes(StandardCharsets.UTF_8);
//        fos.write(data);
        for (int i = 97; i <= 122 ; i++) {
            fos.write(i);
        }
        System.out.println("写出完毕");
        fos.close();
    }
}
